// Custom exception class for negative transfer amount
class NegativeTransferAmountException implements Exception {
  @override
  String toString() {
    return 'Transfer amount cannot be negative';
  }
}

// Custom exception class for insufficient balance
class InsufficientBalanceException implements Exception {
  @override
  String toString() {
    return 'Insufficient account balance';
  }
}

class BankAccount {
  double balance = 1000;

  void transfer(double amount) {
    if (amount < 0) {
      throw NegativeTransferAmountException();
    }
    if (amount > balance) {
      throw InsufficientBalanceException();
    }
    balance -= amount;
    print('Transfer successful. Remaining balance: $balance');
  }
}

void main() {
  BankAccount account = BankAccount();
  try {
    account.transfer(-100);
  } catch (e) {
    if (e is NegativeTransferAmountException) {
      print(e);
    } else if (e is InsufficientBalanceException) {
      print(e);
    } else {
      print('Other error: $e');
    }
  }
}
